package difangame.level;

import java.util.Random;
import difangame.sprite.Stone;
import framework.Sprite;


/**
 * 
 * @author difan, kathleen
 * 
 */

public class Level3 extends PlayableLevel {

    private final int myNextLevelIfWin = 5;
    private final int myNextLevelIfLose = 4;

    @Override
    protected void levelBehavior () {

        for (Sprite s : getMySprites().get("Stone")) {
            Stone st = (Stone) s;
            st.setPrizeStatus(true);
        }
        randomizeStarLocation();
    }

    private void randomizeStarLocation () {
        Random randomGenerator = new Random();
        int r = randomGenerator.nextInt(200);
        if (r == 0) {
            r = randomGenerator.nextInt(pos.length - 1);
            setMyGoalObjectPosition(pos[r + 1]);
        }
    }

    @Override
    protected int getNextLevelIfWin () {
        return myNextLevelIfWin;
    }

    @Override
    protected int getNextLevelIfLose () {
        return myNextLevelIfLose;
    }

}
